package polsl.biai.projekt.server.calculation;

import java.util.ArrayList;

/**
 * represents City (name, id)
 * @author jacek
 *
 */
public class City {
	
	/**
	 * name and unique id of the city
	 */
	private String name;
	private int id;
	/**
	 * distances to other cities
	 */
	private ArrayList<Integer> distances = new ArrayList<Integer>();
	
	public City()
	{
		name="Gliwice";
	}
	
	public City(String n, int i)
	{
		name=n;
		id=i;
	}
	
	/**
	 * 
	 * @return city's name
	 */
	public String getName()
	{
		return name;
	}
	
	/**
	 * 
	 * @return city's id
	 */
	public int getId()
	{
		return id;
	}
	

	/**
	 * sets distance from one city to another
	 * @param c city 
	 * @param d distance to City c
	 */
	public void setDistance(City c, Integer d)
	{
		distances.add(c.id,d);
	}
	
	/**
	 * gets distance from city to City c
	 * @param c
	 * @return
	 */
	public int getDistance(City c)
	{
		return distances.get(c.id);
	}



}
